package cn.tedu.boot01.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@Controller
public class HelloController {
    @RequestMapping("/hello")
    public void hello(HttpServletRequest request, HttpServletResponse response){
        response.setContentType("text/html;charset=utf-8");
        try {
            PrintWriter pw=response.getWriter();
            pw.println("测试成功!<span style='color:pink'>测试成功!</span>");
            pw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
